home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form frm4_3_2
- Caption = "Extract First Name"
- ClientHeight = 1920
- ClientLeft = 1425
- ClientTop = 1620
- ClientWidth = 3825
- BeginProperty Font
- Name = "MS Sans Serif"
- Size = 8.25
- Charset = 0
- Weight = 700
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- LinkTopic = "Form1"
- PaletteMode = 1 'UseZOrder
- ScaleHeight = 1920
- ScaleWidth = 3825
- Begin VB.CommandButton cmdDetermine
- Caption = "Determine First Name"
- Default = -1 'True
- Height = 495
- Left = 480
- TabIndex = 2
- Top = 720
- Width = 2775
- End
- Begin VB.PictureBox picFirstName
- Height = 255
- Left = 120
- ScaleHeight = 195
- ScaleWidth = 3555
- TabIndex = 3
- Top = 1440
- Width = 3615
- End
- Begin VB.TextBox txtFullName
- Height = 285
- Left = 840
- TabIndex = 1
- Top = 240
- Width = 2895
- End
- Begin VB.Label lblName
- Caption = "Name"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 240
- Width = 615
- End
- Attribute VB_Name = "frm4_3_2"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub cmdDetermine_Click()
- Dim nom As String
- 'Determine a person's first name
- nom = txtFullName.Text
- picFirstName.Cls
- picFirstName.Print "The first name is "; FirstName(nom)
- End Sub
- Private Function FirstName(nom As String) As String
- Dim firstSpace As Integer
- 'Extract the first name from a full name
- firstSpace = InStr(nom, " ")
- FirstName = Left(nom, firstSpace - 1)
- End Function
-